<%--
  Created by IntelliJ IDEA.
  User: 王韫琛
  Date: 2021/1/4
  Time: 19:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/webjars/layui/2.5.6/css/layui.css">

</head>
<body>
<table id="demo" lay-filter="test">
</table>
<script type="text/javascript" src="${pageContext.request.contextPath}/webjars/layui/2.5.6/layui.js"></script>
<script>
    layui.use('table', function(){
        var table = layui.table;
        //渲染表格组件
        table.render({
            elem: '#demo'//绑定表格元素，推荐使用ID选择器
            ,height: 468
            ,url: '/basicDataInformation' //异步请求的地址,加入分页后，默认使用page(当前页码)和limit(每页显示数量)作为参数名称
            ,cols: [[ //表头
                //field属性：字段属性，该属性与实体类的属性名一致
                //title属性：表头文本
                //sort标识是否排序
                {field: 'id', title: 'ID', fixed: 'left',align:"center"}
                ,{field: 'username', title: '用户名',align:"center"}
                ,{field: 'name', title: '姓名',align:"center"}
                ,{field: 'gender', title: '性别',align:"center"}
                ,{field: 'permission', title: '身份',align:"center"}
                ,{field: 'identity_card', title: '身份证',align:"center" }
                ,{field: 'addtime', title: '添加时间',align:"center"}
            ]]
            ,request: {
                pageName: 'pageNum' // 页码的参数名称，默认：page
                , limitName: 'pageSize' //每页数据量的参数名，默认：limit
            }
        });
    });
</script>
</body>

</html>
